<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Pagination 分页 | MyWeb 4.x</title>
    <meta name="generator" content="VuePress 1.5.0">
    <link rel="icon" href="/my/favicon.ico">
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c4e5f73318b5cb0c389e3d9a05f831cc";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
    <meta name="description" content="基于Vue + ElementUI 的web项目工程框架，专注于公检法行业中台系统快速搭建，框架已在多个项目实战检验。">
    <link rel="preload" href="/my/assets/css/0.styles.d7ae9199.css" as="style"><link rel="preload" href="/my/assets/js/app.2b2365a7.js" as="script"><link rel="preload" href="/my/assets/js/535.c100cd07.js" as="script"><link rel="preload" href="/my/assets/js/1288.bbd395fa.js" as="script"><link rel="preload" href="/my/assets/js/1025.8afc0690.js" as="script">
    <link rel="stylesheet" href="/my/assets/css/0.styles.d7ae9199.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/my/" class="home-link router-link-active"><img src="/my/img/logo.png" alt="MyWeb 4.x" class="logo"> <span class="site-name can-hide">MyWeb 4.x</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Basic</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Form</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Data</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/my/element/badge.html" class="sidebar-link">Badge 标记</a></li><li><a href="/my/element/pagination.html" aria-current="page" class="active sidebar-link">Pagination 分页</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/element/pagination.html#基础用法" class="sidebar-link">基础用法</a></li><li class="sidebar-sub-header"><a href="/my/element/pagination.html#设置最大页码按钮数" class="sidebar-link">设置最大页码按钮数</a></li><li class="sidebar-sub-header"><a href="/my/element/pagination.html#带有背景色的分页" class="sidebar-link">带有背景色的分页</a></li><li class="sidebar-sub-header"><a href="/my/element/pagination.html#小型分页" class="sidebar-link">小型分页</a></li><li class="sidebar-sub-header"><a href="/my/element/pagination.html#附加功能" class="sidebar-link">附加功能</a></li><li class="sidebar-sub-header"><a href="/my/element/pagination.html#当只有一页时隐藏分页" class="sidebar-link">当只有一页时隐藏分页</a></li><li class="sidebar-sub-header"><a href="/my/element/pagination.html#attributes" class="sidebar-link">Attributes</a></li><li class="sidebar-sub-header"><a href="/my/element/pagination.html#events" class="sidebar-link">Events</a></li><li class="sidebar-sub-header"><a href="/my/element/pagination.html#slot" class="sidebar-link">Slot</a></li></ul></li><li><a href="/my/element/progress.html" class="sidebar-link">Progress 进度条</a></li><li><a href="/my/element/table.html" class="sidebar-link">Table 表格</a></li><li><a href="/my/element/tag.html" class="sidebar-link">Tag 标签</a></li><li><a href="/my/element/tree.html" class="sidebar-link">Tree 树形控件</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Notice</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Navigation</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Others</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="pagination-分页"><a href="#pagination-分页" class="header-anchor">#</a> Pagination 分页</h1> <p>当数据量过多时，使用分页分解数据。</p> <h2 id="基础用法"><a href="#基础用法" class="header-anchor">#</a> 基础用法</h2> <!----><h2 id="设置最大页码按钮数"><a href="#设置最大页码按钮数" class="header-anchor">#</a> 设置最大页码按钮数</h2> <!----><h2 id="带有背景色的分页"><a href="#带有背景色的分页" class="header-anchor">#</a> 带有背景色的分页</h2> <!----><h2 id="小型分页"><a href="#小型分页" class="header-anchor">#</a> 小型分页</h2> <p>在空间有限的情况下，可以使用简单的小型分页。</p> <!----><h2 id="附加功能"><a href="#附加功能" class="header-anchor">#</a> 附加功能</h2> <p>根据场景需要，可以添加其他功能模块。</p> <!----><h2 id="当只有一页时隐藏分页"><a href="#当只有一页时隐藏分页" class="header-anchor">#</a> 当只有一页时隐藏分页</h2> <p>当只有一页时，通过设置 <code>hide-on-single-page</code> 属性来隐藏分页。</p> <!----><h2 id="attributes"><a href="#attributes" class="header-anchor">#</a> Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>small</td> <td>是否使用小型分页样式</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>background</td> <td>是否为分页按钮添加背景色</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>page-size</td> <td>每页显示条目个数，支持 .sync 修饰符</td> <td>number</td> <td>—</td> <td>10</td></tr> <tr><td>total</td> <td>总条目数</td> <td>number</td> <td>—</td> <td>—</td></tr> <tr><td>page-count</td> <td>总页数，total 和 page-count 设置任意一个就可以达到显示页码的功能；如果要支持 page-sizes 的更改，则需要使用 total 属性</td> <td>Number</td> <td>—</td> <td>—</td></tr> <tr><td>pager-count</td> <td>页码按钮的数量，当总页数超过该值时会折叠</td> <td>number</td> <td>大于等于 5 且小于等于 21 的奇数</td> <td>7</td></tr> <tr><td>current-page</td> <td>当前页数，支持 .sync 修饰符</td> <td>number</td> <td>—</td> <td>1</td></tr> <tr><td>layout</td> <td>组件布局，子组件名用逗号分隔</td> <td>String</td> <td><code>sizes</code>, <code>prev</code>, <code>pager</code>, <code>next</code>, <code>jumper</code>, <code>-&gt;</code>, <code>total</code>, <code>slot</code></td> <td>'prev, pager, next, jumper, -&gt;, total'</td></tr> <tr><td>page-sizes</td> <td>每页显示个数选择器的选项设置</td> <td>number[]</td> <td>—</td> <td>[10, 20, 30, 40, 50, 100]</td></tr> <tr><td>popper-class</td> <td>每页显示个数选择器的下拉框类名</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>prev-text</td> <td>替代图标显示的上一页文字</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>next-text</td> <td>替代图标显示的下一页文字</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>disabled</td> <td>是否禁用</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>hide-on-single-page</td> <td>只有一页时是否隐藏</td> <td>boolean</td> <td>—</td> <td>-</td></tr></tbody></table> <h2 id="events"><a href="#events" class="header-anchor">#</a> Events</h2> <table><thead><tr><th>事件名称</th> <th>说明</th> <th>回调参数</th></tr></thead> <tbody><tr><td>size-change</td> <td>pageSize 改变时会触发</td> <td>每页条数</td></tr> <tr><td>current-change</td> <td>currentPage 改变时会触发</td> <td>当前页</td></tr> <tr><td>prev-click</td> <td>用户点击上一页按钮改变当前页后触发</td> <td>当前页</td></tr> <tr><td>next-click</td> <td>用户点击下一页按钮改变当前页后触发</td> <td>当前页</td></tr></tbody></table> <h2 id="slot"><a href="#slot" class="header-anchor">#</a> Slot</h2> <table><thead><tr><th>name</th> <th>说明</th></tr></thead> <tbody><tr><td>—</td> <td>自定义内容，需要在 <code>layout</code> 中列出 <code>slot</code></td></tr></tbody></table></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/my/element/badge.html" class="prev">
        Badge 标记
      </a></span> <span class="next"><a href="/my/element/progress.html">
        Progress 进度条
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/my/assets/js/app.2b2365a7.js" defer></script><script src="/my/assets/js/535.c100cd07.js" defer></script><script src="/my/assets/js/1288.bbd395fa.js" defer></script><script src="/my/assets/js/1025.8afc0690.js" defer></script>
  </body>
</html>
